/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DLoading.java
 *
 * Created on 11-jul-2012, 9:16:55
 */
package Test;

/**
 *
 * @author myguel
 */
public class DLocker extends javax.swing.JDialog {

    /** Creates new form DLoading */
    public DLocker(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        setLocationRelativeTo(null);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlContenedor = new javax.swing.JPanel();
        lblDescripcion = new javax.swing.JLabel();
        lblLoading = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setAlwaysOnTop(true);
        setUndecorated(true);

        pnlContenedor.setBackground(new java.awt.Color(255, 255, 255));
        pnlContenedor.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(102, 153, 255), 1, true));
        pnlContenedor.setLayout(new java.awt.BorderLayout(5, 5));

        lblDescripcion.setBackground(new java.awt.Color(255, 255, 255));
        lblDescripcion.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblDescripcion.setText("Espere porfavor");
        lblDescripcion.setBorder(javax.swing.BorderFactory.createEmptyBorder(3, 5, 5, 5));
        lblDescripcion.setOpaque(true);
        pnlContenedor.add(lblDescripcion, java.awt.BorderLayout.PAGE_END);

        lblLoading.setBackground(new java.awt.Color(255, 255, 255));
        lblLoading.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblLoading.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Test/loading.gif"))); // NOI18N
        lblLoading.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 1, 5));
        lblLoading.setOpaque(true);
        pnlContenedor.add(lblLoading, java.awt.BorderLayout.CENTER);

        getContentPane().add(pnlContenedor, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                DLocker dialog = new DLocker(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
//                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel lblDescripcion;
    private javax.swing.JLabel lblLoading;
    private javax.swing.JPanel pnlContenedor;
    // End of variables declaration//GEN-END:variables
}
